<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="jquery.min.js"></script>
    <style>
        div {
            width: 400px;
            height: 50px;
            background-color: antiquewhite;
            text-align: center;
            line-height: 50px;
        }
    </style>
</head>

<body>
    <button> 显示当前时间</button>
    <div>
        某个时间
    </div>
    <script>
        $(document).ready(function() {
            function showTime() {
                var today = new Date;
                var y = today.getFullYear();
                var M = today.getMonth() + 1;
                var d = today.getDate();
                var w = today.getDay();
                var week = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
                $('div').html(y + '年' + M + '月' + d + '日' + '&nbsp;' + week[w]);
            }

            $("button").click(function() {
                showTime();
                setInterval(showTime, 1000);
            })
        })
    </script>
</body>

</html>